<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/j.tld" prefix="j" %>

<script type="text/javascript">

function loadUndisposeMsgList(){
	var urls = "tbox/tboxMsgLog/list2dispose?sort=id&order=desc&filter=";
	urls = urls + "{\"tbox_msglog__disposeStatus\":{\"op\":\"eq\",\"value\":\"101000\"}}";
	loadAjaxContent(urls);
}

setInterval("myInterval()",10000000);//1000为1秒钟
function myInterval()
{
	$.getJSON("tbox/tboxMsgLog/getUndisposeMsgCount",
		function(data) {
			//alert($("#undisposeMsgCount").text());
			$("#undisposeMsgCount").text(data.undisposeMsgCount);
			$("#undisposeMsgCountDesc").text("有 "+data.undisposeMsgCount+" 条未处理信息");
		});
}

</script>

        <!-- header logo: style can be found in header.less -->
        <header class="header" style="z-index:1"><!-- z-index:1使header不遮盖jquery ui的datepicker  -->
            <a class="logo">
                <!-- Add the class icon to your logo image or logo icon to add the margining -->
                <j:i18n key="admin.common.systemName"/>
            </a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
			  <!-- TAB相关代码 -->
			  <div class="nav-tabs-custom-head">
			  <ul class="nav nav-tabs" role="tablist">
			  </ul>
			  </div>			  
			  <!-- 相关代码结束 -->                
                <div class="navbar-right">
                    <ul class="nav navbar-nav">
                        <!-- Messages: style can be found in dropdown.less-->
                        <li class="dropdown messages-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="fa fa-warning"></i>
                                <span class="label label-success" id="undisposeMsgCount">${undisposeMsgCount}</span>
                            </a>
                            <ul class="dropdown-menu">
                                <li class="header" id="undisposeMsgCountDesc">有  ${undisposeMsgCount} 条未处理信息</li>
                                <li class="footer"><a href="#" onclick='loadUndisposeMsgList()'>查看</a></li>
                            </ul>
                        </li>
                        <!-- User Account: style can be found in dropdown.less -->
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i>
                                <span>${currUser.realName} <i class="caret"></i></span>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- Menu Footer-->
                                <li class="user-footer">
                                    <div class="pull-left">
                                        <a href="#" onclick="loadAjaxContent('sys/user/profile/${currUser.id}')" class="btn btn-default btn-flat"><j:i18n key="admin.index.profile"/></a>
                                    </div>
                                    <div class="pull-right">
                                        <a href="logout" class="btn btn-default btn-flat"><j:i18n key="admin.index.logout"/></a>
                                    </div>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
